function translate(obj,varargin)
%TRANSLATE(INDEXES,VECTOR) translates atoms with indexes INDEXES by a
%translation vector VECTOR. 
%Example: obj.traslate([1,3],[3,4,10])

if nargin == 3
    indexes = varargin{1}; %selected atoms
    vec_trans = varargin{2};
else
    indexes = cell2mat(obj.Atoms.keys); %All atoms
    vec_trans = varargin{1};
end

for k=1:numel(indexes)
    
    Atom = obj.get_atom(indexes(k));
    Atom.Position = Atom.Position + vec_trans; 
    obj.set_atom(indexes(k),Atom); 
    
end

end